Ext.define('DCApp.view.attach.Panel', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.attachpanel',
    requires: [
         'DCApp.view.attach.ListModel',
	     'Ext.data.*',
	     'Ext.util.*',
	     'Ext.view.View',
	     'Ext.ux.DataView.DragSelector',
	     'Ext.ux.DataView.LabelEditor'
     ],   
     cls: 'images-view',
      scrollable: false,
      layout:'fit',
      header:false,
      viewModel: {
          type: 'attachlist'
      },
      controller: 'attachlist',
      tbar: ['->',{
		    	xtype:'fileupload',
		    	multiple:true,
		    	entity_to:'CeAttachment'
		  },{
		      text: '编辑',
		      handler: 'onEdit'
		  },{
    	  text: '关联',
    	  handler: 'onRelList'    	  
      },{
          text: '删除',
          handler: 'onRemove'
      }],
      
     items: {
    	 xtype:'attachview',
         bind: {
             store: '{objs}'
         }
     },
     setEntity_rel_to:function(val){
    	 this.entity_rel_to=val;
     },
    initComponent: function() {        
    	if(this.config.bind){
    		Ext.apply(this, {
    			items:{
    		    	 xtype:'attachview',
    		         bind: this.config.bind	
    			}
    		});
    	}
        this.callParent(arguments);
    }
});